\(\int x^3 (f+g x^2) \log (c (d+e x^2)^p) \, dx\) [311]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 119 \[ \int x^3 \left (f+g x^2\right ) \log \left (c \left (d+e x^2\right )^p\right ) \, dx=\frac {d (3 e f-2 d g) p x^2}{12 e^2}-\frac {(3 e f-2 d g) p x^4}{24 e}-\frac {1}{18} g p x^6-\frac {d^2 (3 e f-2 d g) p \log \left (d+e x^2\right )}{12 e^3}+\frac {1}{4} f x^4 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{6} g x^6 \log \left (c \left (d+e x^2\right )^p\right ) \]

[Out]

1/12*d*(-2*d*g+3*e*f)*p*x^2/e^2-1/24*(-2*d*g+3*e*f)*p*x^4/e-1/18*g*p*x^6-1/12*d^2*(-2*d*g+3*e*f)*p*ln(e*x^2+d)
/e^3+1/4*f*x^4*ln(c*(e*x^2+d)^p)+1/6*g*x^6*ln(c*(e*x^2+d)^p)

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {2525, 45, 2461, 12, 78} \[ \int x^3 \left (f+g x^2\right ) \log \left (c \left (d+e x^2\right )^p\right ) \, dx=\frac {1}{4} f x^4 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{6} g x^6 \log \left (c \left (d+e x^2\right )^p\right )-\frac {d^2 p (3 e f-2 d g) \log \left (d+e x^2\right )}{12 e^3}+\frac {d p x^2 (3 e f-2 d g)}{12 e^2}-\frac {p x^4 (3 e f-2 d g)}{24 e}-\frac {1}{18} g p x^6 \]

[In]

Int[x^3*(f + g*x^2)*Log[c*(d + e*x^2)^p],x]

[Out]

(d*(3*e*f - 2*d*g)*p*x^2)/(12*e^2) - ((3*e*f - 2*d*g)*p*x^4)/(24*e) - (g*p*x^6)/18 - (d^2*(3*e*f - 2*d*g)*p*Lo
g[d + e*x^2])/(12*e^3) + (f*x^4*Log[c*(d + e*x^2)^p])/4 + (g*x^6*Log[c*(d + e*x^2)^p])/6

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 2461

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*(x_)^(m_.)*((f_) + (g_.)*(x_)^(r_.))^(q_.), x_Symbol]
 :> With[{u = IntHide[x^m*(f + g*x^r)^q, x]}, Dist[a + b*Log[c*(d + e*x)^n], u, x] - Dist[b*e*n, Int[SimplifyI
ntegrand[u/(d + e*x), x], x], x] /; InverseFunctionFreeQ[u, x]] /; FreeQ[{a, b, c, d, e, f, g, m, n, q, r}, x]
 && IntegerQ[m] && IntegerQ[q] && IntegerQ[r]

Rule 2525

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.)*((f_) + (g_.)*(x_)^(s_))^(r_.),
 x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(f + g*x^(s/n))^r*(a + b*Log[c*(d + e*x)^p])^q,
x], x, x^n], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q, r, s}, x] && IntegerQ[r] && IntegerQ[s/n] && Intege
rQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0])

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \text {Subst}\left (\int x (f+g x) \log \left (c (d+e x)^p\right ) \, dx,x,x^2\right ) \\ & = \frac {1}{4} f x^4 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{6} g x^6 \log \left (c \left (d+e x^2\right )^p\right )-\frac {1}{2} (e p) \text {Subst}\left (\int \frac {x^2 (3 f+2 g x)}{6 (d+e x)} \, dx,x,x^2\right ) \\ & = \frac {1}{4} f x^4 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{6} g x^6 \log \left (c \left (d+e x^2\right )^p\right )-\frac {1}{12} (e p) \text {Subst}\left (\int \frac {x^2 (3 f+2 g x)}{d+e x} \, dx,x,x^2\right ) \\ & = \frac {1}{4} f x^4 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{6} g x^6 \log \left (c \left (d+e x^2\right )^p\right )-\frac {1}{12} (e p) \text {Subst}\left (\int \left (\frac {d (-3 e f+2 d g)}{e^3}+\frac {(3 e f-2 d g) x}{e^2}+\frac {2 g x^2}{e}-\frac {d^2 (-3 e f+2 d g)}{e^3 (d+e x)}\right ) \, dx,x,x^2\right ) \\ & = \frac {d (3 e f-2 d g) p x^2}{12 e^2}-\frac {(3 e f-2 d g) p x^4}{24 e}-\frac {1}{18} g p x^6-\frac {d^2 (3 e f-2 d g) p \log \left (d+e x^2\right )}{12 e^3}+\frac {1}{4} f x^4 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{6} g x^6 \log \left (c \left (d+e x^2\right )^p\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.18 \[ \int x^3 \left (f+g x^2\right ) \log \left (c \left (d+e x^2\right )^p\right ) \, dx=\frac {d f p x^2}{4 e}-\frac {d^2 g p x^2}{6 e^2}-\frac {1}{8} f p x^4+\frac {d g p x^4}{12 e}-\frac {1}{18} g p x^6-\frac {d^2 f p \log \left (d+e x^2\right )}{4 e^2}+\frac {d^3 g p \log \left (d+e x^2\right )}{6 e^3}+\frac {1}{4} f x^4 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{6} g x^6 \log \left (c \left (d+e x^2\right )^p\right ) \]

[In]

Integrate[x^3*(f + g*x^2)*Log[c*(d + e*x^2)^p],x]

[Out]

(d*f*p*x^2)/(4*e) - (d^2*g*p*x^2)/(6*e^2) - (f*p*x^4)/8 + (d*g*p*x^4)/(12*e) - (g*p*x^6)/18 - (d^2*f*p*Log[d +
 e*x^2])/(4*e^2) + (d^3*g*p*Log[d + e*x^2])/(6*e^3) + (f*x^4*Log[c*(d + e*x^2)^p])/4 + (g*x^6*Log[c*(d + e*x^2
)^p])/6

Maple [A] (verified)

Time = 1.07 (sec) , antiderivative size = 117, normalized size of antiderivative = 0.98

method result size
parts \(\frac {g \,x^{6} \ln \left (c \left (e \,x^{2}+d \right )^{p}\right )}{6}+\frac {f \,x^{4} \ln \left (c \left (e \,x^{2}+d \right )^{p}\right )}{4}-\frac {p e \left (\frac {\frac {2}{3} e^{2} g \,x^{6}-d g \,x^{4} e +\frac {3}{2} f \,x^{4} e^{2}+2 d^{2} g \,x^{2}-3 d e f \,x^{2}}{2 e^{3}}-\frac {d^{2} \left (2 d g -3 e f \right ) \ln \left (e \,x^{2}+d \right )}{2 e^{4}}\right )}{6}\) \(117\)
parallelrisch \(\frac {12 x^{6} \ln \left (c \left (e \,x^{2}+d \right )^{p}\right ) e^{3} g -4 x^{6} e^{3} g p +18 x^{4} \ln \left (c \left (e \,x^{2}+d \right )^{p}\right ) e^{3} f +6 x^{4} d \,e^{2} g p -9 x^{4} e^{3} f p -12 x^{2} d^{2} e g p +18 x^{2} d \,e^{2} f p +12 \ln \left (e \,x^{2}+d \right ) d^{3} g p -18 \ln \left (e \,x^{2}+d \right ) d^{2} e f p +12 d^{3} g p -18 d^{2} e f p}{72 e^{3}}\) \(148\)
risch \(\left (\frac {1}{6} g \,x^{6}+\frac {1}{4} f \,x^{4}\right ) \ln \left (\left (e \,x^{2}+d \right )^{p}\right )-\frac {i \pi g \,x^{6} \operatorname {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) \operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right ) \operatorname {csgn}\left (i c \right )}{12}-\frac {i \pi f \,x^{4} {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{3}}{8}+\frac {i \pi g \,x^{6} {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{2} \operatorname {csgn}\left (i c \right )}{12}+\frac {i \pi f \,x^{4} {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{2} \operatorname {csgn}\left (i c \right )}{8}-\frac {i \pi g \,x^{6} {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{3}}{12}+\frac {i \pi f \,x^{4} \operatorname {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{2}}{8}-\frac {i \pi f \,x^{4} \operatorname {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) \operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right ) \operatorname {csgn}\left (i c \right )}{8}+\frac {i \pi g \,x^{6} \operatorname {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) {\operatorname {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )}^{2}}{12}+\frac {\ln \left (c \right ) g \,x^{6}}{6}-\frac {g p \,x^{6}}{18}+\frac {\ln \left (c \right ) f \,x^{4}}{4}+\frac {x^{4} d g p}{12 e}-\frac {x^{4} f p}{8}-\frac {x^{2} d^{2} g p}{6 e^{2}}+\frac {x^{2} d f p}{4 e}+\frac {\ln \left (e \,x^{2}+d \right ) d^{3} g p}{6 e^{3}}-\frac {\ln \left (e \,x^{2}+d \right ) d^{2} f p}{4 e^{2}}\) \(387\)

[In]

int(x^3*(g*x^2+f)*ln(c*(e*x^2+d)^p),x,method=_RETURNVERBOSE)

[Out]

1/6*g*x^6*ln(c*(e*x^2+d)^p)+1/4*f*x^4*ln(c*(e*x^2+d)^p)-1/6*p*e*(1/2/e^3*(2/3*e^2*g*x^6-d*g*x^4*e+3/2*f*x^4*e^
2+2*d^2*g*x^2-3*d*e*f*x^2)-1/2*d^2*(2*d*g-3*e*f)/e^4*ln(e*x^2+d))

Fricas [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.08 \[ \int x^3 \left (f+g x^2\right ) \log \left (c \left (d+e x^2\right )^p\right ) \, dx=-\frac {4 \, e^{3} g p x^{6} + 3 \, {\left (3 \, e^{3} f - 2 \, d e^{2} g\right )} p x^{4} - 6 \, {\left (3 \, d e^{2} f - 2 \, d^{2} e g\right )} p x^{2} - 6 \, {\left (2 \, e^{3} g p x^{6} + 3 \, e^{3} f p x^{4} - {\left (3 \, d^{2} e f - 2 \, d^{3} g\right )} p\right )} \log \left (e x^{2} + d\right ) - 6 \, {\left (2 \, e^{3} g x^{6} + 3 \, e^{3} f x^{4}\right )} \log \left (c\right )}{72 \, e^{3}} \]

[In]

integrate(x^3*(g*x^2+f)*log(c*(e*x^2+d)^p),x, algorithm="fricas")

[Out]

-1/72*(4*e^3*g*p*x^6 + 3*(3*e^3*f - 2*d*e^2*g)*p*x^4 - 6*(3*d*e^2*f - 2*d^2*e*g)*p*x^2 - 6*(2*e^3*g*p*x^6 + 3*
e^3*f*p*x^4 - (3*d^2*e*f - 2*d^3*g)*p)*log(e*x^2 + d) - 6*(2*e^3*g*x^6 + 3*e^3*f*x^4)*log(c))/e^3

Sympy [A] (verification not implemented)

Time = 61.46 (sec) , antiderivative size = 156, normalized size of antiderivative = 1.31 \[ \int x^3 \left (f+g x^2\right ) \log \left (c \left (d+e x^2\right )^p\right ) \, dx=\begin {cases} \frac {d^{3} g \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{6 e^{3}} - \frac {d^{2} f \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{4 e^{2}} - \frac {d^{2} g p x^{2}}{6 e^{2}} + \frac {d f p x^{2}}{4 e} + \frac {d g p x^{4}}{12 e} - \frac {f p x^{4}}{8} + \frac {f x^{4} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{4} - \frac {g p x^{6}}{18} + \frac {g x^{6} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{6} & \text {for}\: e \neq 0 \\\left (\frac {f x^{4}}{4} + \frac {g x^{6}}{6}\right ) \log {\left (c d^{p} \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(x**3*(g*x**2+f)*ln(c*(e*x**2+d)**p),x)

[Out]

Piecewise((d**3*g*log(c*(d + e*x**2)**p)/(6*e**3) - d**2*f*log(c*(d + e*x**2)**p)/(4*e**2) - d**2*g*p*x**2/(6*
e**2) + d*f*p*x**2/(4*e) + d*g*p*x**4/(12*e) - f*p*x**4/8 + f*x**4*log(c*(d + e*x**2)**p)/4 - g*p*x**6/18 + g*
x**6*log(c*(d + e*x**2)**p)/6, Ne(e, 0)), ((f*x**4/4 + g*x**6/6)*log(c*d**p), True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.91 \[ \int x^3 \left (f+g x^2\right ) \log \left (c \left (d+e x^2\right )^p\right ) \, dx=-\frac {1}{72} \, e p {\left (\frac {4 \, e^{2} g x^{6} + 3 \, {\left (3 \, e^{2} f - 2 \, d e g\right )} x^{4} - 6 \, {\left (3 \, d e f - 2 \, d^{2} g\right )} x^{2}}{e^{3}} + \frac {6 \, {\left (3 \, d^{2} e f - 2 \, d^{3} g\right )} \log \left (e x^{2} + d\right )}{e^{4}}\right )} + \frac {1}{12} \, {\left (2 \, g x^{6} + 3 \, f x^{4}\right )} \log \left ({\left (e x^{2} + d\right )}^{p} c\right ) \]

[In]

integrate(x^3*(g*x^2+f)*log(c*(e*x^2+d)^p),x, algorithm="maxima")

[Out]

-1/72*e*p*((4*e^2*g*x^6 + 3*(3*e^2*f - 2*d*e*g)*x^4 - 6*(3*d*e*f - 2*d^2*g)*x^2)/e^3 + 6*(3*d^2*e*f - 2*d^3*g)
*log(e*x^2 + d)/e^4) + 1/12*(2*g*x^6 + 3*f*x^4)*log((e*x^2 + d)^p*c)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 269 vs. \(2 (107) = 214\).

Time = 0.31 (sec) , antiderivative size = 269, normalized size of antiderivative = 2.26 \[ \int x^3 \left (f+g x^2\right ) \log \left (c \left (d+e x^2\right )^p\right ) \, dx=\frac {{\left (e x^{2} + d\right )}^{2} f p \log \left (e x^{2} + d\right )}{4 \, e^{2}} + \frac {{\left (e x^{2} + d\right )}^{3} g p \log \left (e x^{2} + d\right )}{6 \, e^{3}} - \frac {{\left (e x^{2} + d\right )}^{2} d g p \log \left (e x^{2} + d\right )}{2 \, e^{3}} - \frac {{\left (e x^{2} + d\right )}^{2} f p}{8 \, e^{2}} - \frac {{\left (e x^{2} + d\right )}^{3} g p}{18 \, e^{3}} + \frac {{\left (e x^{2} + d\right )}^{2} d g p}{4 \, e^{3}} + \frac {{\left (e x^{2} + d\right )}^{2} f \log \left (c\right )}{4 \, e^{2}} + \frac {{\left (e x^{2} + d\right )}^{3} g \log \left (c\right )}{6 \, e^{3}} - \frac {{\left (e x^{2} + d\right )}^{2} d g \log \left (c\right )}{2 \, e^{3}} + \frac {{\left (e x^{2} - {\left (e x^{2} + d\right )} \log \left (e x^{2} + d\right ) + d\right )} d e f p - {\left (e x^{2} - {\left (e x^{2} + d\right )} \log \left (e x^{2} + d\right ) + d\right )} d^{2} g p - {\left (e x^{2} + d\right )} d e f \log \left (c\right ) + {\left (e x^{2} + d\right )} d^{2} g \log \left (c\right )}{2 \, e^{3}} \]

[In]

integrate(x^3*(g*x^2+f)*log(c*(e*x^2+d)^p),x, algorithm="giac")

[Out]

1/4*(e*x^2 + d)^2*f*p*log(e*x^2 + d)/e^2 + 1/6*(e*x^2 + d)^3*g*p*log(e*x^2 + d)/e^3 - 1/2*(e*x^2 + d)^2*d*g*p*
log(e*x^2 + d)/e^3 - 1/8*(e*x^2 + d)^2*f*p/e^2 - 1/18*(e*x^2 + d)^3*g*p/e^3 + 1/4*(e*x^2 + d)^2*d*g*p/e^3 + 1/
4*(e*x^2 + d)^2*f*log(c)/e^2 + 1/6*(e*x^2 + d)^3*g*log(c)/e^3 - 1/2*(e*x^2 + d)^2*d*g*log(c)/e^3 + 1/2*((e*x^2
 - (e*x^2 + d)*log(e*x^2 + d) + d)*d*e*f*p - (e*x^2 - (e*x^2 + d)*log(e*x^2 + d) + d)*d^2*g*p - (e*x^2 + d)*d*
e*f*log(c) + (e*x^2 + d)*d^2*g*log(c))/e^3

Mupad [B] (verification not implemented)

Time = 1.50 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.87 \[ \int x^3 \left (f+g x^2\right ) \log \left (c \left (d+e x^2\right )^p\right ) \, dx=\ln \left (c\,{\left (e\,x^2+d\right )}^p\right )\,\left (\frac {g\,x^6}{6}+\frac {f\,x^4}{4}\right )-x^4\,\left (\frac {f\,p}{8}-\frac {d\,g\,p}{12\,e}\right )-\frac {g\,p\,x^6}{18}+\frac {\ln \left (e\,x^2+d\right )\,\left (2\,d^3\,g\,p-3\,d^2\,e\,f\,p\right )}{12\,e^3}+\frac {d\,x^2\,\left (\frac {f\,p}{2}-\frac {d\,g\,p}{3\,e}\right )}{2\,e} \]

[In]

int(x^3*log(c*(d + e*x^2)^p)*(f + g*x^2),x)

[Out]

log(c*(d + e*x^2)^p)*((f*x^4)/4 + (g*x^6)/6) - x^4*((f*p)/8 - (d*g*p)/(12*e)) - (g*p*x^6)/18 + (log(d + e*x^2)
*(2*d^3*g*p - 3*d^2*e*f*p))/(12*e^3) + (d*x^2*((f*p)/2 - (d*g*p)/(3*e)))/(2*e)